/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - VoProductInOrderLinks.as.
 */

package com.model.valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_VoProductInOrderLinks extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("VoProductInOrderLinks") == null)
            {
                flash.net.registerClassAlias("VoProductInOrderLinks", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("VoProductInOrderLinks", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _VoProductInOrderLinksEntityMetadata;

    /**
     * properties
     */
    private var _internal_eta : String;
    private var _internal_po_id : String;
    private var _internal_sales_con_date : String;
    private var _internal_supplier_name : String;
    private var _internal_balance_qty : String;
    private var _internal_customer_name : String;
    private var _internal_sc_serialnumber : int;
    private var _internal_supplier_serialnumber_fk : int;
    private var _internal_pro_serialnumber_fk : int;
    private var _internal_sc_detserialnumber : int;
    private var _internal_po_expected_datetime : String;
    private var _internal_po_issue_date : String;
    private var _internal_po_serialnumber : int;
    private var _internal_pro_qty : int;
    private var _internal_sales_con_code : String;
    private var _internal_customer_serialnumber_fk : int;
    private var _internal_po_detserialnumber : int;

    private static var emptyArray:Array = new Array();


    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_VoProductInOrderLinks()
    {
        _model = new _VoProductInOrderLinksEntityMetadata(this);

        // Bind to own data properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "eta", model_internal::setterListenerEta));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_id", model_internal::setterListenerPo_id));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "sales_con_date", model_internal::setterListenerSales_con_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "supplier_name", model_internal::setterListenerSupplier_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "balance_qty", model_internal::setterListenerBalance_qty));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "customer_name", model_internal::setterListenerCustomer_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_expected_datetime", model_internal::setterListenerPo_expected_datetime));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_issue_date", model_internal::setterListenerPo_issue_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "sales_con_code", model_internal::setterListenerSales_con_code));

    }

    /**
     * data property getters
     */

    [Bindable(event="propertyChange")]
    public function get eta() : String
    {
        return _internal_eta;
    }

    [Bindable(event="propertyChange")]
    public function get po_id() : String
    {
        return _internal_po_id;
    }

    [Bindable(event="propertyChange")]
    public function get sales_con_date() : String
    {
        return _internal_sales_con_date;
    }

    [Bindable(event="propertyChange")]
    public function get supplier_name() : String
    {
        return _internal_supplier_name;
    }

    [Bindable(event="propertyChange")]
    public function get balance_qty() : String
    {
        return _internal_balance_qty;
    }

    [Bindable(event="propertyChange")]
    public function get customer_name() : String
    {
        return _internal_customer_name;
    }

    [Bindable(event="propertyChange")]
    public function get sc_serialnumber() : int
    {
        return _internal_sc_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get supplier_serialnumber_fk() : int
    {
        return _internal_supplier_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fk() : int
    {
        return _internal_pro_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get sc_detserialnumber() : int
    {
        return _internal_sc_detserialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get po_expected_datetime() : String
    {
        return _internal_po_expected_datetime;
    }

    [Bindable(event="propertyChange")]
    public function get po_issue_date() : String
    {
        return _internal_po_issue_date;
    }

    [Bindable(event="propertyChange")]
    public function get po_serialnumber() : int
    {
        return _internal_po_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get pro_qty() : int
    {
        return _internal_pro_qty;
    }

    [Bindable(event="propertyChange")]
    public function get sales_con_code() : String
    {
        return _internal_sales_con_code;
    }

    [Bindable(event="propertyChange")]
    public function get customer_serialnumber_fk() : int
    {
        return _internal_customer_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get po_detserialnumber() : int
    {
        return _internal_po_detserialnumber;
    }

    /**
     * data property setters
     */

    public function set eta(value:String) : void
    {
        var oldValue:String = _internal_eta;
        if (oldValue !== value)
        {
            _internal_eta = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "eta", oldValue, _internal_eta));
        }
    }

    public function set po_id(value:String) : void
    {
        var oldValue:String = _internal_po_id;
        if (oldValue !== value)
        {
            _internal_po_id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_id", oldValue, _internal_po_id));
        }
    }

    public function set sales_con_date(value:String) : void
    {
        var oldValue:String = _internal_sales_con_date;
        if (oldValue !== value)
        {
            _internal_sales_con_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sales_con_date", oldValue, _internal_sales_con_date));
        }
    }

    public function set supplier_name(value:String) : void
    {
        var oldValue:String = _internal_supplier_name;
        if (oldValue !== value)
        {
            _internal_supplier_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "supplier_name", oldValue, _internal_supplier_name));
        }
    }

    public function set balance_qty(value:String) : void
    {
        var oldValue:String = _internal_balance_qty;
        if (oldValue !== value)
        {
            _internal_balance_qty = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "balance_qty", oldValue, _internal_balance_qty));
        }
    }

    public function set customer_name(value:String) : void
    {
        var oldValue:String = _internal_customer_name;
        if (oldValue !== value)
        {
            _internal_customer_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "customer_name", oldValue, _internal_customer_name));
        }
    }

    public function set sc_serialnumber(value:int) : void
    {
        var oldValue:int = _internal_sc_serialnumber;
        if (oldValue !== value)
        {
            _internal_sc_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sc_serialnumber", oldValue, _internal_sc_serialnumber));
        }
    }

    public function set supplier_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_supplier_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_supplier_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "supplier_serialnumber_fk", oldValue, _internal_supplier_serialnumber_fk));
        }
    }

    public function set pro_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_pro_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_pro_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fk", oldValue, _internal_pro_serialnumber_fk));
        }
    }

    public function set sc_detserialnumber(value:int) : void
    {
        var oldValue:int = _internal_sc_detserialnumber;
        if (oldValue !== value)
        {
            _internal_sc_detserialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sc_detserialnumber", oldValue, _internal_sc_detserialnumber));
        }
    }

    public function set po_expected_datetime(value:String) : void
    {
        var oldValue:String = _internal_po_expected_datetime;
        if (oldValue !== value)
        {
            _internal_po_expected_datetime = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_expected_datetime", oldValue, _internal_po_expected_datetime));
        }
    }

    public function set po_issue_date(value:String) : void
    {
        var oldValue:String = _internal_po_issue_date;
        if (oldValue !== value)
        {
            _internal_po_issue_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_issue_date", oldValue, _internal_po_issue_date));
        }
    }

    public function set po_serialnumber(value:int) : void
    {
        var oldValue:int = _internal_po_serialnumber;
        if (oldValue !== value)
        {
            _internal_po_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_serialnumber", oldValue, _internal_po_serialnumber));
        }
    }

    public function set pro_qty(value:int) : void
    {
        var oldValue:int = _internal_pro_qty;
        if (oldValue !== value)
        {
            _internal_pro_qty = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_qty", oldValue, _internal_pro_qty));
        }
    }

    public function set sales_con_code(value:String) : void
    {
        var oldValue:String = _internal_sales_con_code;
        if (oldValue !== value)
        {
            _internal_sales_con_code = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sales_con_code", oldValue, _internal_sales_con_code));
        }
    }

    public function set customer_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_customer_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_customer_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "customer_serialnumber_fk", oldValue, _internal_customer_serialnumber_fk));
        }
    }

    public function set po_detserialnumber(value:int) : void
    {
        var oldValue:int = _internal_po_detserialnumber;
        if (oldValue !== value)
        {
            _internal_po_detserialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_detserialnumber", oldValue, _internal_po_detserialnumber));
        }
    }

    /**
     * Data property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerEta(value:flash.events.Event):void
    {
        _model.invalidateDependentOnEta();
    }

    model_internal function setterListenerPo_id(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_id();
    }

    model_internal function setterListenerSales_con_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSales_con_date();
    }

    model_internal function setterListenerSupplier_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSupplier_name();
    }

    model_internal function setterListenerBalance_qty(value:flash.events.Event):void
    {
        _model.invalidateDependentOnBalance_qty();
    }

    model_internal function setterListenerCustomer_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCustomer_name();
    }

    model_internal function setterListenerPo_expected_datetime(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_expected_datetime();
    }

    model_internal function setterListenerPo_issue_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_issue_date();
    }

    model_internal function setterListenerSales_con_code(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSales_con_code();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.etaIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_etaValidationFailureMessages);
        }
        if (!_model.po_idIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_idValidationFailureMessages);
        }
        if (!_model.sales_con_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_sales_con_dateValidationFailureMessages);
        }
        if (!_model.supplier_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_supplier_nameValidationFailureMessages);
        }
        if (!_model.balance_qtyIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_balance_qtyValidationFailureMessages);
        }
        if (!_model.customer_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_customer_nameValidationFailureMessages);
        }
        if (!_model.po_expected_datetimeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_expected_datetimeValidationFailureMessages);
        }
        if (!_model.po_issue_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_issue_dateValidationFailureMessages);
        }
        if (!_model.sales_con_codeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_sales_con_codeValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _VoProductInOrderLinksEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _VoProductInOrderLinksEntityMetadata) : void
    {
        var oldValue : _VoProductInOrderLinksEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfEta : Array = null;
    model_internal var _doValidationLastValOfEta : String;

    model_internal function _doValidationForEta(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfEta != null && model_internal::_doValidationLastValOfEta == value)
           return model_internal::_doValidationCacheOfEta ;

        _model.model_internal::_etaIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isEtaAvailable && _internal_eta == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "eta is required"));
        }

        model_internal::_doValidationCacheOfEta = validationFailures;
        model_internal::_doValidationLastValOfEta = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_id : Array = null;
    model_internal var _doValidationLastValOfPo_id : String;

    model_internal function _doValidationForPo_id(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_id != null && model_internal::_doValidationLastValOfPo_id == value)
           return model_internal::_doValidationCacheOfPo_id ;

        _model.model_internal::_po_idIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_idAvailable && _internal_po_id == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_id is required"));
        }

        model_internal::_doValidationCacheOfPo_id = validationFailures;
        model_internal::_doValidationLastValOfPo_id = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSales_con_date : Array = null;
    model_internal var _doValidationLastValOfSales_con_date : String;

    model_internal function _doValidationForSales_con_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSales_con_date != null && model_internal::_doValidationLastValOfSales_con_date == value)
           return model_internal::_doValidationCacheOfSales_con_date ;

        _model.model_internal::_sales_con_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSales_con_dateAvailable && _internal_sales_con_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "sales_con_date is required"));
        }

        model_internal::_doValidationCacheOfSales_con_date = validationFailures;
        model_internal::_doValidationLastValOfSales_con_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSupplier_name : Array = null;
    model_internal var _doValidationLastValOfSupplier_name : String;

    model_internal function _doValidationForSupplier_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSupplier_name != null && model_internal::_doValidationLastValOfSupplier_name == value)
           return model_internal::_doValidationCacheOfSupplier_name ;

        _model.model_internal::_supplier_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSupplier_nameAvailable && _internal_supplier_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "supplier_name is required"));
        }

        model_internal::_doValidationCacheOfSupplier_name = validationFailures;
        model_internal::_doValidationLastValOfSupplier_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfBalance_qty : Array = null;
    model_internal var _doValidationLastValOfBalance_qty : String;

    model_internal function _doValidationForBalance_qty(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfBalance_qty != null && model_internal::_doValidationLastValOfBalance_qty == value)
           return model_internal::_doValidationCacheOfBalance_qty ;

        _model.model_internal::_balance_qtyIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isBalance_qtyAvailable && _internal_balance_qty == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "balance_qty is required"));
        }

        model_internal::_doValidationCacheOfBalance_qty = validationFailures;
        model_internal::_doValidationLastValOfBalance_qty = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCustomer_name : Array = null;
    model_internal var _doValidationLastValOfCustomer_name : String;

    model_internal function _doValidationForCustomer_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCustomer_name != null && model_internal::_doValidationLastValOfCustomer_name == value)
           return model_internal::_doValidationCacheOfCustomer_name ;

        _model.model_internal::_customer_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCustomer_nameAvailable && _internal_customer_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "customer_name is required"));
        }

        model_internal::_doValidationCacheOfCustomer_name = validationFailures;
        model_internal::_doValidationLastValOfCustomer_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_expected_datetime : Array = null;
    model_internal var _doValidationLastValOfPo_expected_datetime : String;

    model_internal function _doValidationForPo_expected_datetime(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_expected_datetime != null && model_internal::_doValidationLastValOfPo_expected_datetime == value)
           return model_internal::_doValidationCacheOfPo_expected_datetime ;

        _model.model_internal::_po_expected_datetimeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_expected_datetimeAvailable && _internal_po_expected_datetime == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_expected_datetime is required"));
        }

        model_internal::_doValidationCacheOfPo_expected_datetime = validationFailures;
        model_internal::_doValidationLastValOfPo_expected_datetime = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_issue_date : Array = null;
    model_internal var _doValidationLastValOfPo_issue_date : String;

    model_internal function _doValidationForPo_issue_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_issue_date != null && model_internal::_doValidationLastValOfPo_issue_date == value)
           return model_internal::_doValidationCacheOfPo_issue_date ;

        _model.model_internal::_po_issue_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_issue_dateAvailable && _internal_po_issue_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_issue_date is required"));
        }

        model_internal::_doValidationCacheOfPo_issue_date = validationFailures;
        model_internal::_doValidationLastValOfPo_issue_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSales_con_code : Array = null;
    model_internal var _doValidationLastValOfSales_con_code : String;

    model_internal function _doValidationForSales_con_code(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSales_con_code != null && model_internal::_doValidationLastValOfSales_con_code == value)
           return model_internal::_doValidationCacheOfSales_con_code ;

        _model.model_internal::_sales_con_codeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSales_con_codeAvailable && _internal_sales_con_code == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "sales_con_code is required"));
        }

        model_internal::_doValidationCacheOfSales_con_code = validationFailures;
        model_internal::_doValidationLastValOfSales_con_code = value;

        return validationFailures;
    }
    

}

}
